import { createApp } from "vue";
import { Toast, Loading, Popup } from "vant";
import "vant/es/toast/style";
import "vant/es/image-preview/style";
import "normalize.css";
import App from "./App.vue";
import router from "./router.js";
import "../../style/common.less";
import "../../style/fitvant.css";

String.prototype.replaceAll = function (s1, s2) {
  return this.replace(new RegExp(s1, "gm"), s2);
};

if (import.meta.env.MODE.trim() === "beta") {
  new VConsole();
}

window.supportWebGL = !!document.createElement("canvas").getContext("webgl");

const app = createApp(App);

app.config.globalProperties.$toast = Toast;
app.config.globalProperties.$config = {};

app.use(router).use(Loading).use(Popup).mount("#app");
